﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace QuanLyThuNgan
{
    public class DMLyDoKhongThuTienDAO
    {
        public bool m_Insert(DMLyDoKhongThuTienDTO _info)
        {
            int istop = 0;
            if (_info.BStop == true)
                istop = 1;
            string _sql = string.Format("usp_ThuNgan_DMLyDoKhongThuTien_Insert  N'{0}',{1}", _info.STenLyDo, istop);
            return Uit.it_SQL.ExecuteNonQuery(_sql, false);
        }
        public bool m_Update(DMLyDoKhongThuTienDTO _info)
        {
            int istop = 0;
            if (_info.BStop == true)
                istop = 1;
            string _sql = string.Format("usp_ThuNgan_DMLyDoKhongThuTien_Update {0},N'{1}',{2}", _info.IIDLyDoKTT, _info.STenLyDo, istop);
            return Uit.it_SQL.ExecuteNonQuery(_sql, false);
        }
        public bool m_Delete(DMLyDoKhongThuTienDTO _info)
        {
            string _sql = string.Format("usp_ThuNgan_DMLyDoKhongThuTien_Delete {0}", _info.IIDLyDoKTT);
            return Uit.it_SQL.ExecuteNonQuery(_sql, false);
        }

        public DataTable m_SelectAllDMLyDoKTT()
        {
            string _sql = string.Format("usp_ThuNgan_DMLyDoKhongThuTien_SelectAll ");
            return Uit.it_SQL.getDataTable(_sql, null, "");
        }
    }
}
